//
//  QuestionTableViewCell.swift
//  worldexchange
//
//  Created by xionghao on 2019/1/10.
//  Copyright © 2019 xionghao. All rights reserved.
//

import UIKit

class QuestionTableViewCell: QMUITableViewCell {

    @IBOutlet weak var descriptionLabel: UILabel!
    @IBOutlet weak var titleLabel: UILabel!
    @IBOutlet weak var thumbImageView: UIImageView!
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
        self.contentView.qmui_borderPosition = .bottom
        self.contentView.qmui_borderColor = UIColor.qmui_color(withHexString: "#d5d5d5")
        self.contentView.qmui_borderWidth = 0.5
    }
    
    var item:ArticleItem! {
        didSet {
            self.thumbImageView.kf.setImage(with: URL(string: IMAGE_HOST + item.image))
            let locale = LanguageHelper.shareInstance.locale
            if locale == "en" {
                self.titleLabel.text = item.etitle
                self.descriptionLabel.text = item.eex_title
            } else if (locale == "th") {
                self.titleLabel.text = item.ttitle
                self.descriptionLabel.text = item.tex_title
            }else {
                self.titleLabel.text = item.title
                self.descriptionLabel.text = item.ex_title
            }
        }
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
}
